package com.dapeng.cleardatabackend.job;

import com.dapeng.cleardatabackend.service.GraphService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;


/**
 * @author dapeng
 * @description 删除无效图谱
 */
@Slf4j
@Component
public class ClearJob {

    @Resource
    private GraphService graphService;

    /**
     * 每天晚上0点清楚创建失败的数据
     */
    @Scheduled(cron = "0 0 0 * * ?")
    public void clearFailJob() {
        graphService.clearFailCreate();
        graphService.deleteUnUsedIndex();
    }
}
